// 
// SoapTrace.Net - A soap message monitoring utility. 
// 
// Copyright (C) 2004 Matthew Ward
// 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// 
// Matthew Ward (mrward@users.sourceforge.net)
// 

using System;
using SoapTrace.Core.Communication;

namespace SoapTrace.Core.Formatters
{
	/// <summary>
	/// The interface that all message formatters have to implement.
	/// </summary>
	public interface IMessageFormatter
	{
		/// <summary>
		/// Formats the soap request.
		/// </summary>
		/// <param name="server">The host name of the server
		/// or the IP address.</param>
		/// <param name="uri">The URI of the request.</param>
		/// <param name="webServiceName">The web service name.</param>
		/// <param name="webMethod">The web service operation.</param>
		/// <param name="message">The message request.</param>
		/// <returns>A formatted soap request that will
		/// be displayed in the SoapTrace's GUI.</returns>
		FormattedText FormatRequest( string server,
		    string uri,
			string webServiceName, 
			string webMethod, 
			ISoapMessage message );

		/// <summary>
		/// Formats the soap response.
		/// </summary>
		/// <param name="server">The host name of the server
		/// or the IP address.</param>
		/// <param name="uri">The URI of the response.</param>
		/// <param name="webServiceName">The web service name.</param>
		/// <param name="webMethod">The web service operation.</param>
		/// <param name="message">The message response.</param>
		/// <returns>A formatted soap response that will
		/// be displayed in the SoapTrace's GUI.</returns>
		FormattedText FormatResponse( string server,
		    string uri,
			string webServiceName, 
			string webMethod, 
			ISoapMessage message );

		/// <summary>
		/// The name of the message formatter.
		/// </summary>
		string Name{ get; }

		/// <summary>
		/// Returns whether or not the message formatter
		/// can be configured.
		/// </summary>
		bool IsConfigurable{ get; }

		/// <summary>
		/// Returns a configuration editor interface so the
		/// message formatter can be configured.
		/// </summary>
		IConfigurationEditor ConfigurationEditor{ get; }
	}
}
